/*# include <iostream>
# include <cstring>
# include <string>
using namespace std;
int main()
{
    string s1;
    string s2;
    while(cin>>s1&&s1!="#")
    {
        cin>>s2;
        int sum=0;
        string s="0";
        int l1=s1.length();
        int l2=s2.length();
        for(int i=0;i<l1-l2;)
            {
                s="0";
                for(int j=i;j<i+l2;j++)
                  {
                      s+=s1[j];
                  }
                 if(s==s2)
                    {
                        sum++;
                        i=i+l2;
                    }
                 else
                        i++;
            }
            cout<<sum<<endl;
    }
    return 0;
}
*/
# include <stdio.h>
# include <string.h>
int main()
{
    char *p;
    char a[105],b[105];
    int len;
    int c;
    while(scanf("%s",a)&&a[0]!='#')
    {
        c=0;
        scanf("%s",b);
        len=strlen(b);
        for(p=a;p=strstr(p,b);p+=len)
             c++;
        printf("%d\n",c);

    }
    return 0;
}
